﻿using Common.Objects;
using Common.Objects.Enums;
using EYCmsAdmin.Domain.Models;
using FluentNHibernate.Mapping;

namespace EYCmsAdmin.NHibernate.Mappings
{
    public class UserInfoMap : ClassMap<UserInfo>
    {
        public UserInfoMap()
        {
            Table("UserInfo");
            Id(m => m.Id, "UserInfoId").GeneratedBy.Identity();
            Map(m => m.DateBirth).Not.Nullable();
            Map(m => m.Gender).Not.Nullable().CustomType<GenderTypes>();
            Map(m => m.Name).Length(255).Nullable();
            Map(m => m.Surname).Length(255).Nullable();
        }
    }
}